home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_asps4j72.asp < prev    next >
Encoding:
Text File  |  1999-07-29  |  3.7 KB  |  64 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  2. <HTML>
  3. <HEAD>
  4. <META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
  5. <TITLE>Setting Expiration Information</TITLE>
  6. <SCRIPT LANGUAGE="JavaScript">
  7. <!--
  8.     TempString = navigator.appVersion
  9.     if (navigator.appName == "Microsoft Internet Explorer"){    
  10. // Check to see if browser is Microsoft
  11.         if (TempString.indexOf ("4.") >= 0){
  12. // Check to see if it is IE 4
  13.             document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
  14.         }
  15.         else {
  16.             document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
  17.         }
  18.     }
  19.     else if (navigator.appName == "Netscape") {                        
  20. // Check to see if browser is Netscape
  21.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
  22.     }
  23.     else
  24.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
  25. //-->
  26. </script>
  27. <SCRIPT LANGUAGE="VBScript">
  28. <!--
  29. Sub Window_OnLoad()
  30.    Dim frmContents
  31.    On Error Resume Next
  32.    If Not Parent Is Nothing Then
  33.       Set frmContents = Parent.Contents
  34.       If Not frmContents Is Nothing Then
  35.             frmContents.Window.TOCSynch_Click
  36.       End If
  37.    End If
  38. End Sub
  39. //--></SCRIPT><META NAME="DESCRIPTION" CONTENT="Internet Information Services reference information">
  40. <META HTTP-EQUIV="PICS-Label" CONTENT='(PICS-1.1 "<http://www.rsac.org/ratingsv01.html>" l comment "RSACi North America Server" by "inet@microsoft.com <mailto:inet@microsoft.com>" r (n 0 s 0 v 0 l 0))'>
  41. <META NAME="MS.LOCALE" CONTENT="EN-US">
  42. <META NAME="MS-IT-LOC" Content="Internet Information Services"> 
  43. </HEAD>
  44.  
  45. <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
  46.  
  47. <H2><A NAME="_setting_expiration_information"></A><SUP> <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/asp/asps4j72.asp&srcfile=Interaction/Expire" %></SUP>Setting Expiration Information</H2>
  48.  
  49. <H6>Overview</H6>
  50.  
  51. <P>You can give every page or script on the server an expiration date. The expiration date can either be in the form of an absolute date, such as January 1, 2000, or a relative date, such as 600 minutes from the time the page was first downloaded by the client browser. If a client browser requests that same page again before the expiration date and time, then the client browser uses its own cached copy.</P>
  52.  
  53. <H6>Code Tour</H6>
  54.  
  55. <P>This example illustrates how your script can set the expiration date for a file. The <B>Response.Expires</B> property is used to set the relative expiration date. The unit of measurement is minutes, so if this property is set to 10, as in the example, then the page will expire after 10 minutes.</P>
  56.  
  57. <P>The <B>Response.ExpiresAbsolute</B> property is used to specify an absolute expiration date. In this example, the page is specified to expire on January 1, 1999, at 1:30:15 P.M. Either the time or the date can be left out when assigning an expiration date.</P>
  58.  
  59. <P><B><B>Note   </B></B>IIS sends all HTTP headers required for a given Web page or script before any HTML is sent to the client browser. Therefore, all statements and methods that modify the HTTP headers of the response, including setting the <B>Response.Expires</B> and <B>Response.ExpiresAbsolute</B> properties, must be located before the <HTML> tag in your script. If your script attempts to modify the HTTP headers after the server has begun sending HTML content back to the client browser, the script will generate an error.</P>
  60. <hr class="iis" size="1">
  61. <p align="center"><em><a href="../../../common/colegal.htm">© 1997-1999 Microsoft Corporation. All rights reserved.</a></em></p>
  62. </BODY>
  63. </HTML>
  64.